<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:g="http://giava.by/common/base"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	template="/WEB-INF/layout/popupTiny.xhtml">

	<ui:define name="title">
		<h:outputText value="Lista Immagini" />
	</ui:define>
	<ui:define name="content">
		<style>
.pager {
	text-decoration: none;
	border: 1px solid #000099;
	color: #000099;
	padding: 2px;
}

.selected {
	text-decoration: none;
	border: 1px solid #000099;
	color: #000099;
	background-color: white;
	padding: 2px;
}
</style>

		<h:form prependId="false">

			<div id="doc" class="yui-t7">
				<center>
					<br />
					<p:panel header="Scegli una immagine con un click!"
						style="width: 450px;" id="images">
						<h:inputText value="#{imageController.search.obj.name}" />
						<h:commandButton action="#{imageController.reload}"
							value="Filtra per nome" />
						<br />
						<br />
						<p:dataTable id="imagesList" rowIndexVar="rowIndex" var="r"
							value="#{imageController.model}"
							rows="#{imageController.pageSize}" paginator="true"
							dynamic="true">
							<p:column width="50">
								<center>
									<h:outputText value="#{rowIndex+1} " />
								</center>
							</p:column>
							<p:column>
								<f:facet name="header">
									<h:outputText value="nome" />
								</f:facet>
								<h:outputText value="#{r.name}" />
							</p:column>
							<p:column>
								<f:facet name="header">
									<h:outputText value="anteprima" />
								</f:facet>
								<center>
									<h:graphicImage value="/img/#{r.name}"
										rendered="#{r.type == 'img'}"
										width="#{g:imageWidthProportionalUrl('img/'.concat(r.name),100,100)}"
										height="#{g:imageHeightProportionalUrl('img/'.concat(r.name), 100, 100)}" />
								</center>
							</p:column>
						</p:dataTable>



						<div style="clear: both;"></div>
						<br />
					</p:panel>
				</center>
			</div>
		</h:form>
	</ui:define>
</ui:composition>
